class Account {//账号
    private double balance;//余额
    private String number;//卡号

    public Account(double balance,String number) {
        this.balance = balance;
        this.number = number;
    }

//取钱
    protected void withfraw(double money) throws AccountException {
        if (money > balance)
            throw new AccountException("余额不足，余额只有$"+balance);
            balance-=money;
    }
    public double getBalance(){
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getNumber() {
        return number;
    }
}
